package cn.wolfcode.crm.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Date;
import java.util.HashMap;

@Setter
@Getter
@ToString
public class Notice {
    private Long id;

    private Employee uer;

    private Date pubdate;

    private String title;

    private String content;

    private boolean status;

    /**
     * 定义json属性用作前端回显
     * @return
     */
    public String getJson() {
        //封装数据更加安全
        HashMap<Object, Object> map = new HashMap<>();
        map.put("id", id);
        map.put("title", title);
        map.put("content", content);

        return JSON.toJSONString(map);
    }



}